package com.mdd.common.enums;

/**
 * redis 枚举
 */
public enum RedisKey {
    PUSH_CLASS("push_class", "发布分类"),
    WX_NOTIFY_TENANT_ID("WX_NOTIFY_TENANT_ID", "微信支付回调租户ID");

    private String key;
    private String desc;

    RedisKey(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static RedisKey getKey(String key) {
        for (RedisKey redisKey : values()) {
            if (key.equals(redisKey.getKey())) {
                return redisKey;
            }
        }
        return null;
    }
}
